<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>订单管理</title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
	{include file="public/css"/}

</head>
<body>
<div class="layui-fluid">
	<div class="layui-row layui-col-space15">
		<div class="layui-card layui-col-md12">
			<div class="layui-card-header">
				{if input('param.isopen')==1}<i class="layui-icon layui-icon-close" style="font-size:18px;font-weight:bold;cursor:pointer" onclick="closeself()"></i>{/if}
			</div>
			<div class="layui-card-body" pad15>
				<div class="layui-col-md12">
					<div class="layui-col-md12 layui-form layui-form-search">
						<div class="layui-inline">
							<label class="layui-form-label">寄存时间</label>
							<div class="layui-input-inline" style="width:180px;">
								<input type="text" name="createtime" id="create_time" autocomplete="off" class="layui-input">
							</div>
						</div>
						<div class="layui-inline">
							<label class="layui-form-label">类型</label>
							<div class="layui-input-inline">
								<select name="type">
									<option value="">全部</option>
									<option value="0" {if input('param.type')==='0'}selected{/if}>存入</option>
									<option value="1" {if input('param.type')==='1'}selected{/if}>取出</option>
								</select>
							</div>
						</div>
						<div class="layui-inline">
							<button class="layui-btn layuiadmin-btn-replys" lay-submit="" lay-filter="LAY-app-forumreply-search">
								<i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
							</button>
						</div>
					</div>
				</div>
				<div class="layui-col-md12">
					<table id="tabledata" lay-filter="tabledata"></table>
				</div>
			</div>
		</div>
	</div>
</div>
{include file="public/js"/}
<script>
	var table = layui.table;
	var datawhere = {};
	{if input('?param.status') && input('param.status')!==''}
	datawhere['status'] = "{$Request.param.status}";
	{/if}
		//数据表
		var tableIns = table.render({
			elem: '#tabledata'
			,url: "{$Request.url}" //数据接口
			,page: true //开启分页
			//,size:'sm'
			,cols: [[ //表头
				{field: 'id', title: 'ID',  sort: true,width:70},
				{field: 'createtime', title: '时间',sort: true,width:200,templet:function(d){ return date('Y-m-d H:i:s',d.createtime);}},
				{field: 'status', title: '类型',templet:function(d){
						var html = '';
						if(d.type==0) html+='<div style="color:#ff8758">存入</span>';
						if(d.type==1) html+='<div style="color:#008000">取出</span>';
						return html;
					},width:80},

				{field: 'num', title: '数量',width:100},
					
				{field: 'remark', title: '备注'}
			]]
		});
		//排序
		table.on('sort(tabledata)', function(obj){
			datawhere.field = obj.field;
			datawhere.order = obj.type;
			tableIns.reload({
				initSort: obj,
				where: datawhere
			});
		});
		//日期范围选择
		layui.laydate.render({
			elem: '#create_time',
			trigger: 'click',
			range: '~' //或 range: '~' 来自定义分割字符
		});
		//检索
		layui.form.on('submit(LAY-app-forumreply-search)', function(obj){
			var field = obj.field
			var olddatawhere = datawhere
			datawhere = field
			datawhere.field = olddatawhere.field
			datawhere.order = olddatawhere.order
			tableIns.reload({
				where: datawhere,
				page: {curr: 1}
			});
		})
</script>



{include file="public/copyright"/}
</body>
</html>